home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Contributed Scores
/
Peter Stone Punctus
/
SuperStrings
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-26
|
8KB
|
190 lines
(defun pep-to-chord-1 (pep)
(cadr (assoc pep '(
(a (f 2 g# 2 c 3 f 4))
(b (g 2 c# 3 c# 3 e 3))
(c (f 2 c# 3 f 2 c# 3))
(d (c 2 d# 2 d 2 g 2))))))
(defun pep-to-chord-2 (pep)
(cadr (assoc pep '(
(a (c 2 f 2 g 2 c 2))
(b (a# 2 a# 2 f 3 c 3))
(c (c# 3 a# 2 c# 3 g 2))
(d (g 2 g 2 f# 2 c# 2))))))
(defun pep-to-chord-3 (pep)
(cadr (assoc pep '(
(a (f 3 g# 3 a# 3 c 3))
(b (a# 3 a# 3 f 3 c 3))
(c (g 3 g 3 g 4 g 3))
(d (g 3 g 3 f# 3 c# 3))))))
(defun pep-to-chord (pep type transp)
(cond ((equal type '1)
(transpose-chord (pep-to-chord-1 pep) transp))
((equal type '2)
(transpose-chord (pep-to-chord-2 pep) transp))
((equal type '3)
(transpose-chord (pep-to-chord-3 pep) transp))
(t (diagnostic (list "illegal type in pep-to-chord" $cr$)))))
(defun pep-to-trans (pep)
(cadr (assoc pep '((a 0)
(b -2)
(c 5)
(d 7)))))
(defun peps-to-chords (peps type trans-len)
(prog (out trans-val chord-val count transpeps)
(cond ((null trans-len) (setq trans-len 4)))
(setq transpeps peps)
(setq count trans-len)
loop
(cond ((null peps) (return (reversewoc out))))
(cond ((equal count trans-len)
(setq trans-val (pep-to-trans (car transpeps)))
(setq transpeps (cdr transpeps))
(setq count 1))
(t (setq count (add1 count))))
(setq chord-val (pep-to-chord (car peps) type trans-val))
(setq out (xcons out chord-val))
(setq peps (cdr peps))
(go loop)))
(setq samples 4096)
(setq mod 0.1)
(setq rdepth 2)
(setq circle1
'(gen-sin 10 mod samples 0
(vector-mix (gen-sin 9 mod samples 0
(vector-mix (gen-sin 8 mod samples 0
(vector-mix (gen-sin 7 mod samples 0
(vector-mix (gen-sin 6 mod samples 0
(vector-mix (gen-sin 5 mod samples 0
(vector-mix (gen-sin 4 mod samples 0
(vector-mix (gen-sin 3 mod samples 0
(vector-mix (gen-sin 2 mod samples 0
(vector-mix (gen-sin 1 mod samples 0
(vector-mix x (gen-sin 4 mod samples 0)))
(gen-sin 5 mod samples 0)))
(gen-sin 6 mod samples 0)))
(gen-sin 7 mod samples 0)))
(gen-sin 8 mod samples 0)))
(gen-sin 9 mod samples 0)))
(gen-sin 10 mod samples 0)))
(gen-sin 1 mod samples 0)))
(gen-sin 2 mod samples 0)))
(gen-sin 3 mod samples 0))))
(setq circle2
'(gen-sin 4 mod samples 0
(vector-mix (gen-sin 3 mod samples 0
(vector-mix (gen-sin 2 mod samples 0
(vector-mix (gen-sin 1 mod samples 0
(vector-mix (gen-sin 10 mod samples 0
(vector-mix (gen-sin 9 mod samples 0
(vector-mix (gen-sin 8 mod samples 0
(vector-mix (gen-sin 7 mod samples 0
(vector-mix (gen-sin 6 mod samples 0
(vector-mix (gen-sin 5 mod samples 0
(vector-mix x (gen-sin 8 mod samples 0)))
(gen-sin 9 mod samples 0)))
(gen-sin 10 mod samples 0)))
(gen-sin 1 mod samples 0)))
(gen-sin 2 mod samples 0)))
(gen-sin 3 mod samples 0)))
(gen-sin 4 mod samples 0)))
(gen-sin 5 mod samples 0)))
(gen-sin 6 mod samples 0)))
(gen-sin 7 mod samples 0))))
(setq circle3
'(gen-sin 6 mod samples 0
(vector-mix (gen-sin 5 mod samples 0
(vector-mix (gen-sin 4 mod samples 0
(vector-mix (gen-sin 3 mod samples 0
(vector-mix (gen-sin 2 mod samples 0
(vector-mix (gen-sin 1 mod samples 0
(vector-mix (gen-sin 10 mod samples 0
(vector-mix (gen-sin 9 mod samples 0
(vector-mix (gen-sin 8 mod samples 0
(vector-mix (gen-sin 7 mod samples 0
(vector-mix x (gen-sin 10 mod samples 0)))
(gen-sin 1 mod samples 0)))
(gen-sin 2 mod samples 0)))
(gen-sin 3 mod samples 0)))
(gen-sin 4 mod samples 0)))
(gen-sin 5 mod samples 0)))
(gen-sin 6 mod samples 0)))
(gen-sin 7 mod samples 0)))
(gen-sin 8 mod samples 0)))
(gen-sin 9 mod samples 0))))
(setq vhorn (self-modulate circle1 rdepth 2))
(setq vstrings (self-modulate circle2 rdepth 2))
(setq vpizzicato (self-modulate circle3 rdepth 2))
(def-orchestra 'orchestra
all (horn strings pizzicato)
strings (strings1 strings2)
)
(setq tempo-zone-len (/ (get-ratio '256/1 :ratio)
(get-ratio '1/8 :ratio)))
; note: tuning is synthesizer specific, decrease/increase accordingly
; it's purpose here is to detune everything slightly
(def-section sect-a
default
zone (symbol-repeat 256 '(1/1))
tempo-zones (symbol-trim tempo-zone-len '(1/8))
tempo (vector-to-list (vector-round 77 85 vstrings))
horn
channel 1
tonality (peps-to-chords (vector-to-symbol a d vhorn) 1 4)
symbol (vector-to-symbol a l vhorn)
length '(1/16)
duration '(1/25)
velocity (vector-round 50 95 vstrings)
tuning (vector-to-list (vector-round -300 300 (gen-noise-white samples 1 0.1212)))
strings1
channel 2
tonality (peps-to-chords (vector-to-symbol a d vstrings) 2 4)
symbol (vector-to-symbol a l vstrings)
length '(1/16)
duration '(1/25)
velocity (vector-round 50 95 vpizzicato)
tuning (vector-to-list (vector-round -300 300 (gen-noise-white samples 1 0.2212)))
pizzicato
channel 3
tonality (peps-to-chords (vector-to-symbol a d vpizzicato) 3 4)
symbol (vector-to-symbol a l vpizzicato)
length '(1/16)
duration '(1/25)
velocity (vector-round 60 95 vhorn)
tuning (vector-to-list (vector-round -300 300 (gen-noise-white samples 1 0.3212)))
strings2
channel 6
tonality (peps-to-chords (vector-to-symbol a d vstrings) 2 4)
symbol (vector-to-symbol a l vstrings)
length '(1/16)
duration '(1/25)
velocity (vector-round 50 95 vpizzicato)
tuning (vector-to-list (vector-round -300 300 (gen-noise-white samples 1 0.22212)))
)
(init-rnd 0.223541)
;(def-expression
; horn ((legato 100 10 0.34) (humanize 0 2 0.14) (velocity 2 0.42))
; strings ((legato 100 10 0.34) (humanize 0 2 0.14) (velocity 2 0.42))
; pizzicato ((legato 100 10 0.34) (humanize 0 2 0.14) (velocity 2 0.42))
;)
(play-file-p nil
all '(sect-a)
)